{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Report - 报告题目\n",
    "\n",
    "* 姓名: 谢岑林\n",
    "* 学号: 2017300376\n",
    "\n",
    "\n",
    "## 任务简介\n",
    "\n",
    "背景介绍: 泰坦尼克号的沉没是世界上最出名的船难之一, 在他的处女航中, 泰坦尼克号由于撞击冰山后沉没, 使船上包括船员在内的2224人中的1502人遇难。这严重的灾难使国际社会震惊, 并由此产生了对船只更高要求的安全管理制度。其中使船难出现如此重大伤亡的原因就是缺少足够的救生艇。使乘客幸存下来的原因有很多, 但是有部分原因的权重似乎更高, 比如: 女人, 小孩, 上层人士。需要对各种因素进行归类分析, 预测出哪些人群在这样的灾难中更容易幸存。\n",
    "\n",
    "## 解决途径\n",
    "\n",
    "主要包括：\n",
    "1. 和report1一样也是一个二分类问题, 但是由于report1中K-Means的拟合度并不好, 所以这次选用Sklearn的逻辑回归\n",
    "2. 观察数据后先处理一下各项参数, 排除掉一些影响较小的参数:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " 先观察阶级和获救与否的关联性: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAETCAYAAADZHBoWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAZKElEQVR4nO3df5RdZX3v8ffHJBoRBA0pYhKcKOhVpAQIoAvipcBCEBrs1RBsFeqihvqTLuqt0GoJXWVdtFiL1uWCVVqpQgMiClj8gShCtSgZ+V2kgiJMk0IIEH4GCXzvH2dnd0wm4QRy5kxm3q+1Zs3ez37OPt8zs9Z8Zj/PPs9JVSFJEsAL+l2AJGnsMBQkSS1DQZLUMhQkSS1DQZLUMh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nz+NnPOlM4v/zlL3nzm9/M3nvvzSc+8YnR/WFI2qL4juYe+Na3vsUrX/lKbrzxRm655RYOPfTQjfYfHBzkkksu4fzzz+foo4/mwgsvBGD58uUsW7aMvfbaq+277bbbsvvuu/ODH/wAgMsuu4y3vvWtTJkyhUWLFvG5z32OwcFBzjjjDD7wgQ8AcMIJJ/D+97+f6667jle84hU9etWSxgNDoQd22203vvvd7/Kxj32Ma665hm233fil7/z583nxi18MwFFHHcVXvvIVAC688EIWLFiwXv+FCxdywQUXALBkyRIWLlzIo48+yo9+9CMWLFjAnDlzOP7441m+vDMl88Mf/pB3vetdALznPe/ZbK9T0vizRS+IN1a99rWvZXBwkMsvv5yTTz6ZQw45hMmTJ7dDPuu+se4lL3lJuz1jxgymTZvGTTfdxAUXXMBZZ5213vnnz5/PySefzAMPPMDg4CAHHnggjz32GNtttx033HDDiDV5d5Gkbnil0APLli1jq6224t3vfjcf/ehH+elPf8rAwACDg4MAfPWrX93o448++mg+9alPsWrVKnbbbbf1jm+99dbss88+nHDCCRxxxBFMmjSJl770pcyePbu9yqgqbrzxRgD2228/lixZAsB55523OV+qpHHGUOiBm2++mX322Yc5c+Zw2mmn8fGPf5xTTjmFE044gXnz5jFp0qSNPv6d73wnS5Ys4aijjtpgn4ULF/LlL3+ZhQsXtm3nnXce55xzDrvvvju77rorl1zSudv3zDPP5POf/zx77703q1aNnbscJI09W/THcc6dO7fW/TyF2267jde//vV9qmjL5s9OY5a3pG5WSQaHLVL6G7xSkCS1DAVJUstQkCS1DAVJUstQkCS1DAVJUstQGAWLFy/mjDPOeN7nGb6oniT1wvhf5mJz3988hpa4laTNzSuFHjnttNN43etex8EHH8ztt98OsMGlrS+77DL23Xdf9thjDw4++GDuvfdeAFauXMkhhxzCHnvswfHHH8+W/EZDSVsGQ6EHBgcHWbJkCddffz0XX3wx1113HcAGl7bef//9ufbaa7n++uvbdY8ATj31VPbff3+uv/565s+fz91339231yRpYhj/w0d9cM011/B7v/d7bLXVVkBnVd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khcDP66q3+5rgaNszLxPYaJLctOGDgE7jGYt2mSTqupRgKq6K8kBwEVJXsXIy7dobFlTVU8Djye5s6oeBqiqJ5I80+faRp2hMHbsALwVeHCd9gA/Gv1ytAn+O8mcqroBoLliOAL4R2C3/pamLvw6yVZV9Tiw19rGJNsChoL65hvA1mv/sAyX5KrRL0eb4BhgzfCGqloDHJPkrP6UpE3wlqp6EqCqhofAFODY/pTUP84pSJJa3pIqSWoZCpKklqEgPUdJFif5aL/rkDYnQ0GS1DIUpC4lOSbJTUluTPKldY69L8l1zbGvJtmqaV+Q5Jam/eqmbdckP0lyQ3O+XfrxeqSRePeR1IUkuwIXA/tV1f1JXg58BHi0qs5IMq2qVjZ9/xq4t6o+17xb9tCq+q8k21XVQ0k+B1xbVec1nzI4qaqe6Ndrk4bzSkHqzoHARVV1P0BVPbDO8TcmuaYJgT8Adm3afwh8Mcn76HyiIMC/A3+e5GPAqwwEjSWGgtSdABu7rP4i8KGq2g04FZgKUFV/DHwcmAXc0FxRnA/MB54Avp3kwF4WLm0KQ0HqzpXAUUmmATTDR8NtAyxPMoXOlQJNv9dU1Y+r6i+B+4FZSV4N/KKqPgtcCkyoBdc0trnMhdSFqro1yWnAD5I8DVwP3DWsyyeAHwO/Am6mExIAf9NMJIdOsNwInAS8O8lTdFbl/KtReRFSF5xoliS1HD6SJLUMBUlSy1CQJLUMBUlSy1CQJLUMBUlSy1CQJLUMBUlS6/8D27aZhUs1JLUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "\"\"\"\n",
    "Created on Wed Nov 22 18:39:22 2019\n",
    "\n",
    "@author: XCL01\n",
    "\"\"\"\n",
    "\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "data_train = pd.read_csv(r'D:\\Files\\machinelearning_homework\\report_02_Titanic\\train.csv') \n",
    "\n",
    "Survived_0 = data_train.Pclass[data_train.Survived == 0].value_counts() # 幸存\n",
    "Survived_1 = data_train.Pclass[data_train.Survived == 1].value_counts() # 死亡\n",
    "df = pd.DataFrame({u'survived':Survived_1,u'dead':Survived_0})\n",
    "df.plot(kind = 'bar', stacked = True)\n",
    "plt.title(u'class_affect')\n",
    "plt.xlabel(u'class')\n",
    "plt.ylabel(u'number')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如上图显然阶级和生还概率有关"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "再观察性别和获救与否的关联性:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\ipykernel_launcher.py:36: MatplotlibDeprecationWarning: Unrecognized location 'bast'. Falling back on 'best'; valid locations are\n",
      "\tbest\n",
      "\tupper right\n",
      "\tupper left\n",
      "\tlower left\n",
      "\tlower right\n",
      "\tright\n",
      "\tcenter left\n",
      "\tcenter right\n",
      "\tlower center\n",
      "\tupper center\n",
      "\tcenter\n",
      "This will raise an exception in 3.3.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEICAYAAAC3Y/QeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3de5wcdZnv8c83EAiYyCUJCARNlCBy0RhazBGEKCgXj6AeUDiK4KKjHthFQVfOcQ8EvK2KckRuDsICsnJR1yUHCSgQVnDl0kiIEERCiDIQIYaAIteEZ/+oX0On6Zm+Vc/0TH3fr1e/prrqV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VJfA+8m+IN5DltuJZMV/rzqxtL3dpmkjntuk8iVTm9s1wEfTOs8BnoiIFQ1iGr7iH3W6hiDbkP8gaRnZHu6ngfvIjoGdS/ZhGMqPyZJw+RBtLgM+kv5WfBg4Slk3s3fz0g9JxwJHS7qNbIOptx6/SctaBPwEuLHBMueR/et2I9lhrkou+oBPke3lrgD+CHxBL3WT8U2yDfpHkhalwwa5ymNdkpOBPSX9Bnh3WpdauwC3SlpE9l5/Oc13GllRfD/Zj3yXAyvJfuw/sGr+yns91Bdhru91J9rM7aVkudibl3JxLPAxSffzUm4fk7SE7Mvw8xGxisHz+530fq1tEPKwf5aGUq9eROpKhnQYh+yL72vA5Eocg8Qyj/a3Wxj53K4mq4szJA2QFf9TlJ0wsUl6/WVkvyudS3bWZEPu3sHMrIB8ha+ZWQG5+JuZFZCLv5lZAbn4m5kVkIu/mVkBufibmRWQi7+ZWQH9F3jvbOkxJvElAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 5 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "\"\"\"\n",
    "Created on Wed Nov 22 18:39:22 2019\n",
    "\n",
    "@author: XCL01\n",
    "\"\"\"\n",
    "\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "data_train = pd.read_csv(r'D:\\Files\\machinelearning_homework\\report_02_Titanic\\train.csv') \n",
    "Survived_0 = data_train.Pclass[data_train.Survived == 0].value_counts() # 幸存\n",
    "Survived_1 = data_train.Pclass[data_train.Survived == 1].value_counts() # 死亡\n",
    "\n",
    "fig = plt.figure()\n",
    "plt.title(u'gender and classes')\n",
    "\n",
    "ax1 = fig.add_subplot(141) \n",
    "data_train.Survived[data_train.Sex == 'female'][data_train.Pclass != 3].value_counts().plot(kind = 'bar', label = 'female high class', color = 'red')\n",
    "ax1.set_xticklabels([u'survived',u'dead'], rotation = 0) \n",
    "ax1.legend([u'f/H'], loc = 'best')\n",
    "\n",
    "ax2 = fig.add_subplot(142, sharey = ax1) \n",
    "data_train.Survived[data_train.Sex == 'female'][data_train.Pclass == 3].value_counts().plot(kind = 'bar', label = 'female low class', color = 'blue')\n",
    "ax2.set_xticklabels([u'dead', u'survived'], rotation=0)\n",
    "plt.legend([u\"f/L\"], loc='best')\n",
    "\n",
    "ax3 = fig.add_subplot(143, sharey = ax1)\n",
    "data_train.Survived[data_train.Sex == 'male'][data_train.Pclass != 3].value_counts().plot(kind = 'bar', label = 'male high class', color = 'yellow')\n",
    "ax3.set_xticklabels([u'dead',u'survived'], rotation = 0)\n",
    "plt.legend([u'm/H'], loc = 'best')\n",
    "\n",
    "ax4 = fig.add_subplot(144, sharey = ax1)\n",
    "data_train.Survived[data_train.Sex == 'male'][data_train.Pclass == 3].value_counts().plot(kind = 'bar', label = 'male low class', color = 'green')\n",
    "ax4.set_xticklabels([u'dead',u'survived'], rotation = 0)\n",
    "plt.legend([u'm/L'], loc = 'bast')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "再观察港口和获救与否的关联性:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 432x288 with 0 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 21508 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 30331 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 38470 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 28207 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 21475 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20056 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 23458 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 30340 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 33719 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 25937 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 24773 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20917 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 30331 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 38470 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 28207 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 21475 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 20154 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:211: RuntimeWarning: Glyph 25968 missing from current font.\n",
      "  font.set_text(s, 0.0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20154 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 25968 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 21508 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20056 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 23458 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 30340 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 33719 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 25937 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 24773 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n",
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\matplotlib\\backends\\backend_agg.py:180: RuntimeWarning: Glyph 20917 missing from current font.\n",
      "  font.set_text(s, 0, flags=flags)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEUCAYAAADEGSquAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAVWklEQVR4nO3dfZBV9Z3n8fd3AAeRCIpoDJBpZkIyJrF4ENGUYjlqEZ8KtCKCtVErZS1uohYpN7vRrWRtq9YqkzKbaMZyQ4WZ4EYHiNECZ9XVYIxuUrh2i49BSzRZ7YERRO3xCR/id//o079p4TY0Tp++3fT7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Gagk2F8FcQQ8iPgjQbt71R9Gtx+AIwF/iIzj8rMmcARwF9GxE3A7U2tboB59dEgEBGPZ+b0avlGYFtmtlbrj2XmjGbWp92LiKcy84u99D2ZmUcOdE3qu4jYBEzLnf4YVpN0vgKclpnrm1JcE7inMDiMiIju8zsnA/f36PO8z+A3ejd9+w9YFfq4Ptw5EAAy8090/Qdt2AQCGAqDxT8Av4mINXQdcngIuo5V03UISYPbIxHx73dujIiLgPYm1KO98/uIuGDnxoj4KrCxCfU0lYePBomIOBY4HLg3M9+q2j4LjM3MR5tanHYrIg4D7qDrvFB3CMwG9gPOzsx/blZt2rOImETXeYN36Pr9JXA0XXt5Z2fmPzWxvAFnKEj9JCL+Bug+t/B0Zt6/u/EaXCLiJOALdM3Y/HRmrmtySU1hKEiSCs8pSJIKQ0GSVBgKkqTCUJAkFd4YJfVRRLQCxwIfVE0jgfW9tLE37d13sEvNZihIe2dxZr4OEBHjgW/20tbb2N21S03n4SNJUmEoSJIKQ0GSVBgKkqTCUJAkFYaCJKnwklSp77YCN0fEh9X6nwH39NLGx2iXms5ZUiVJhYePJEmFoSBJKgwFSVJhKEiSCkNBklT8f0KjFPePgnMdAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "\"\"\"\n",
    "Created on Wed Nov 22 18:39:22 2019\n",
    "\n",
    "@author: XCL01\n",
    "\"\"\"\n",
    "\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "data_train = pd.read_csv(r'D:\\Files\\machinelearning_homework\\report_02_Titanic\\train.csv') \n",
    "Survived_0 = data_train.Pclass[data_train.Survived == 0].value_counts() # 幸存\n",
    "Survived_1 = data_train.Pclass[data_train.Survived == 1].value_counts() # 死亡\n",
    "\n",
    "fig = plt.figure()\n",
    "fig.set(alpha = 0.2)\n",
    "Survived_0 = data_train.Embarked[data_train.Survived == 0].value_counts()\n",
    "Survived_1 = data_train.Embarked[data_train.Survived == 1].value_counts()\n",
    "df = pd.DataFrame({u'survived':Survived_1,u'dead':Survived_0})\n",
    "df.plot(kind = 'bar', stacked = True)\n",
    "plt.title(u'各登陆港口乘客的获救情况')\n",
    "plt.xlabel(u'登陆港口')\n",
    "plt.ylabel(u'人数')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如图上船港口和生还概率影响不大"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train_acc： 0.797752808988764\n",
      "test_acc： 0.8022388059701493\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ShouldBeCheck\\Anaconda\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "\"\"\"\n",
    "Created on Wed Nov 22 18:39:22 2019\n",
    "\n",
    "@author: XCL01\n",
    "\"\"\"\n",
    "\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pandas import Series,DataFrame\n",
    "from sklearn.linear_model import LogisticRegression \n",
    "from  sklearn.model_selection import train_test_split\n",
    "\n",
    "data_train = pd.read_csv(r'D:\\Files\\machinelearning_homework\\report_02_Titanic\\train.csv') \n",
    "Survived_0 = data_train.Pclass[data_train.Survived == 0].value_counts() # 幸存\n",
    "Survived_1 = data_train.Pclass[data_train.Survived == 1].value_counts() # 死亡\n",
    "data_test = pd.read_csv(r'D:\\Files\\machinelearning_homework\\report_02_Titanic\\test.csv') # 导入测验集数据\n",
    "\n",
    "y = data_train['Survived']\n",
    "del data_train['Survived']\n",
    "sum_id = data_test['PassengerId'] \n",
    "df = pd.merge(data_train, data_test,how='outer') \n",
    "\n",
    "df = df.drop(['Name','PassengerId','Ticket','Cabin'],axis=1) \n",
    "# 删除姓名、ID、船票信息、客舱信息，axis=0 删除行，=1 删除列\n",
    "\n",
    "df['Age'] = df['Age'].fillna(df['Age'].mean()) \n",
    " # 用平均值填充空值\n",
    "df['Fare'] = df['Fare'].fillna(df['Fare'].mean())\n",
    "df['Embarked'] = df['Embarked'].fillna( df['Embarked'].value_counts().index[0]) \n",
    "# 用数量最多项填充\n",
    "\n",
    "dumm = pd.get_dummies(df[['Sex','Embarked']])\n",
    "df = df.join(dumm)\n",
    "del df['Sex'] \n",
    "del df['Embarked']\n",
    "\n",
    "#数据降维\n",
    "df['Age'] = (df['Age']-df['Age'].min()) /(df['Age'].max()-df['Age'].min())\n",
    "df['Fare'] = (df['Fare']-df['Fare'].min()) /(df['Fare'].max()-df['Fare'].min())\n",
    "\n",
    "#训练模型\n",
    "data_train = df[:len(data_train)]\n",
    "data_test = df[len(data_train):]\n",
    "\n",
    "X_train, X_val, y_train,y_val = train_test_split(data_train,y,test_size=0.3, random_state=42) \n",
    "LR = LogisticRegression()\n",
    "\n",
    "LR.fit(X_train, y_train) # 训练数据\n",
    "print('train_acc：',LR.score(X_train, y_train))\n",
    "print('test_acc：',LR.score(X_val, y_val))\n",
    "pred= LR.predict(data_test) # pred 为预测结果\n",
    "\n",
    "pred = pd.DataFrame({'PassengerId':sum_id.values, 'Survived':pred}) # 格式化预测结果\n",
    "\n",
    "pred.to_csv('pred_LR.csv',index=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 总结\n",
    "在完善信息的部分简单的用众数和平均数解决, 如果在填充前先进行训练和预测, 将填充数据“计算”出来, 那得到的拟合结果可能会更好.\n",
    "在做题过程中学到了“哑变量”, 其实这不是一个新的概念, 在第一道题的时候区分男女就是无意识的运用了哑变量的知识. 哑变量和原变量给我的感觉就像数电和模电一样."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "main_language": "python"
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
